package org.ziwei.paipan;

import java.util.ArrayList;
import java.util.List;

import org.ziwei.paipan.var.BoShiShen;
import org.ziwei.paipan.var.ChangShengShen;
import org.ziwei.paipan.var.DiZhi;
import org.ziwei.paipan.var.JiangQianShen;
import org.ziwei.paipan.var.ShiErGong;
import org.ziwei.paipan.var.TaiSuiShen;
import org.ziwei.paipan.var.TianGan;

/**
 * 命盘中的每个宫
 * @author dwt
 *
 */
public class Gong {
	
	private TianGan gongGan;		//宫干

	private DiZhi gongZhi;			//宫支
	
	private ShiErGong shiErGong;	//十二宫
	
	private int startDaXian;		//大限起始年年
	
	private int endDaXian;			//大限结束年
	
	private List<Star> zhengYaoList = new ArrayList<Star>();	//正曜列表
	
	private List<Star> fuYaoList = new ArrayList<Star>();	//辅曜列表
	
	private List<Star> zaYaoList = new ArrayList<Star>();    //杂曜
	
	private	ChangShengShen changShengShen;	//长生十二神
	
	private BoShiShen boShiShen;			//博士十二神
	
	private TaiSuiShen taiSuiShen;			//太岁十二神
	
	private JiangQianShen jiangQianShen;	//将前十二神

	private ShiErGong daYunShiErGong;		//大运十二宫
	
	private ShiErGong liuNianShiErGong;		//流年十二宫

	private List<Star> yunYaoList = new ArrayList<Star>();  //运曜列表
		
	private List<Star> liuYaoList = new ArrayList<Star>();  //流曜列表
	
	private int liuYue;
	
	public List<Star> getAllStar(){
		List<Star> stars = new ArrayList<Star>();
		stars.addAll(zhengYaoList);
		stars.addAll(fuYaoList);
		stars.addAll(zaYaoList);
		return stars;
	}
	
	public String toString(){
		 String str = "宫干:"+ this.gongGan.getName() +"\n" +
				      "宫支:"+ this.gongZhi.getName() +"\n" +
			          "十二宫:"+ this.shiErGong.getName() +"\n" +
			          "大限起终年:"+ this.startDaXian+"-"+ this.endDaXian +"\n";
		 str += "正曜:";
		 for(int i=0; i<zhengYaoList.size(); i++){
			 Star star = zhengYaoList.get(i);
			 str += star.getStarName()+"("+ star.getStarMX().getName()+")";
			 if(star.getSiHua() != null){
				 str += star.getSiHua().getName();
			 }
			 str += " ";
		 }
		 str += "\n辅曜:";
		 for(int i=0; i<fuYaoList.size(); i++){
			 Star star = fuYaoList.get(i);
			 str += star.getStarName()+"("+ star.getStarMX().getName()+")";
			 if(star.getSiHua() != null){
				 str += star.getSiHua().getName();
			 }
			 str += " ";
		 }
		 str += "\n杂曜:";
		 for(int i=0; i<zaYaoList.size(); i++){
			 Star star = zaYaoList.get(i);
			 str += star.getStarName();
			 if(star.getSiHua() != null){
				 str += star.getSiHua().getName();
			 }
			 str += " ";
		 }
		 str += "\n长生十二神:" + this.changShengShen.getName() +"\n" +
				 "博士十二神:" + this.boShiShen.getName() +"\n" +
				 "太岁十二神:" + this.taiSuiShen.getName() +"\n" +
				 "将前十二神:" + this.jiangQianShen.getName() +"\n" ;
		 
		 str +=  "大限十二宫:"+ this.daYunShiErGong.getName() +"\n运曜:";
		 for(int i=0; i<yunYaoList.size(); i++){
			 str += yunYaoList.get(i).getStarName()+" ";
		 }
		 str += "\n流年十二宫:"+ this.liuNianShiErGong.getName() +"\n流曜:";
		 for(int i=0; i<liuYaoList.size(); i++){
			 str += liuYaoList.get(i).getStarName()+" ";
		 }
		 str += "\n流月:" + liuYue + "\n";
		 return str;
	}
	
	
	public TianGan getGongGan() {
		return gongGan;
	}

	public void setGongGan(TianGan gongGan) {
		this.gongGan = gongGan;
	}

	public DiZhi getGongZhi() {
		return gongZhi;
	}

	public void setGongZhi(DiZhi gongZhi) {
		this.gongZhi = gongZhi;
	}

	public ShiErGong getShiErGong() {
		return shiErGong;
	}

	public void setShiErGong(ShiErGong shiErGong) {
		this.shiErGong = shiErGong;
	}

	public int getStartDaXian() {
		return startDaXian;
	}

	public void setStartDaXian(int startDaXian) {
		this.startDaXian = startDaXian;
	}

	public int getEndDaXian() {
		return endDaXian;
	}

	public void setEndDaXian(int endDaXian) {
		this.endDaXian = endDaXian;
	}

	public List<Star> getZhengYaoList() {
		return zhengYaoList;
	}

	public void setZhengYaoList(List<Star> zhengYaoList) {
		this.zhengYaoList = zhengYaoList;
	}

	public List<Star> getFuYaoList() {
		return fuYaoList;
	}

	public void setFuYaoList(List<Star> fuYaoList) {
		this.fuYaoList = fuYaoList;
	}

	public List<Star> getZaYaoList() {
		return zaYaoList;
	}

	public void setZaYaoList(List<Star> zaYaoList) {
		this.zaYaoList = zaYaoList;
	}

	public ChangShengShen getChangShengShen() {
		return changShengShen;
	}

	public void setChangShengShen(ChangShengShen changShengShen) {
		this.changShengShen = changShengShen;
	}

	public BoShiShen getBoShiShen() {
		return boShiShen;
	}

	public void setBoShiShen(BoShiShen boShiShen) {
		this.boShiShen = boShiShen;
	}

	public TaiSuiShen getTaiSuiShen() {
		return taiSuiShen;
	}

	public void setTaiSuiShen(TaiSuiShen taiSuiShen) {
		this.taiSuiShen = taiSuiShen;
	}

	public JiangQianShen getJiangQianShen() {
		return jiangQianShen;
	}

	public void setJiangQianShen(JiangQianShen jiangQianShen) {
		this.jiangQianShen = jiangQianShen;
	}

	public ShiErGong getDaYunShiErGong() {
		return daYunShiErGong;
	}

	public void setDaYunShiErGong(ShiErGong daYunShiErGong) {
		this.daYunShiErGong = daYunShiErGong;
	}

	public ShiErGong getLiuNianShiErGong() {
		return liuNianShiErGong;
	}

	public void setLiuNianShiErGong(ShiErGong liuNianShiErGong) {
		this.liuNianShiErGong = liuNianShiErGong;
	}

	public List<Star> getYunYaoList() {
		return yunYaoList;
	}

	public void setYunYaoList(List<Star> yunYaoList) {
		this.yunYaoList = yunYaoList;
	}

	public List<Star> getLiuYaoList() {
		return liuYaoList;
	}

	public void setLiuYaoList(List<Star> liuYaoList) {
		this.liuYaoList = liuYaoList;
	}

	public int getLiuYue() {
		return liuYue;
	}

	public void setLiuYue(int liuYue) {
		this.liuYue = liuYue;
	}
}
